package com.kuailework.module.${module}.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageInfo;
import com.kuailework.module.${module}.bean.${Entity};
import com.kuailework.module.${module}.service.${Entity}Service;

/**
 * ${tb.comment}的维护
 * 
 * @author Qiang.Liu
 *
 */
@RestController
public class ${Entity}Controller {

	@Autowired
	private ${Entity}Service ${entity}Service;

	// ${tb.comment}的列表
	@RequestMapping("/${entity}/List")
	public PageInfo<${Entity}> list(int pageNum, int pageSize) {
		return ${entity}Service.page(pageNum, pageSize);
	}

	// ${tb.comment}的编辑
	@RequestMapping("/${entity}/edit")
	public ${Entity} edit(${Entity} record) {
		return ${entity}Service.edit(record);
	}

	// ${tb.comment}的详情
	@RequestMapping("/${entity}/get")
	public ${Entity} detail(Long id) {
		return ${entity}Service.get(id);
	}

	// ${tb.comment}的删除
	@RequestMapping("/${entity}/remove")
	public void remove(Long id) {
		${entity}Service.remove(id);
	}
	
}
